﻿<UserControl x:Class="XSemmel.Schema.EditorValidation"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:Schema="clr-namespace:XSemmel.Schema"
             mc:Ignorable="d" 
             d:DesignHeight="150" d:DesignWidth="400">
    <UserControl.Resources>
        <Schema:IssueTypeToColorConverter x:Key="IssueTypeToColorConverter"/>
    </UserControl.Resources>
    <DockPanel>
        <ScrollViewer Grid.Row="1">
            <ListBox
                ScrollViewer.HorizontalScrollBarVisibility="Auto"
                ScrollViewer.VerticalScrollBarVisibility="Auto"
                x:Name="_lstErrors" x:FieldModifier="private"
                SelectionChanged="lstErrors_SelectionChanged">

                <ListBox.ItemTemplate>
                    <DataTemplate>
                        <DockPanel>
                            <Ellipse Margin="3 1 10 1" DockPanel.Dock="Left" Width="8" Height="8"
                                     Fill="{Binding Path=IssueType, Converter={StaticResource IssueTypeToColorConverter}}"
                                     />
                            <TextBlock Text="{Binding Message}"></TextBlock>
                        </DockPanel>
                    </DataTemplate>
                </ListBox.ItemTemplate>
                
            </ListBox>
        </ScrollViewer>
    </DockPanel>
</UserControl>
